package _1010.funcref;

import org.junit.Test;

public class NoStaticRefDemo {
	interface M<T>{
		T withDeal();
	}
	interface M2<T,R>{
		R withDeal(T t);
	}
	
	@Test
	public void t1() {
		M<Boolean> m = "hello"::isEmpty;
		System.out.println(m.withDeal());  // "hello".isEmpty()
		
		M2<String,Boolean> m2 = "hello world"::endsWith;
		System.out.println(m2.withDeal("rld"));  // "hello world".endsWith("rld")
		
		M2<Integer,String> m3 = "hello world"::substring;
		System.out.println(m3.withDeal(3));  // "hello world".substring(3)
	}
}
